package com.gardenguell.salad.ui.fragment;

import android.app.ProgressDialog;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBar;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.gardenguell.salad.R;
import com.gardenguell.salad.app.AppConstant;
import com.gardenguell.salad.data.volley.OnErrorResponse;
import com.gardenguell.salad.ui.activity.base.BaseActivity;
import com.gardenguell.salad.util.CommonLog;
import com.gardenguell.salad.util.SharedPreferenceUtil;
import com.gardenguell.salad.util.ViewUtil;

/**
 * Created by absurd on 2015/11/20.
 */
public class BaseFragment extends Fragment implements View.OnClickListener, OnErrorResponse{

    protected SharedPreferenceUtil prefUtil = SharedPreferenceUtil.getInstance();


    protected BaseActivity getBaseActivity() {
        if (getActivity() == null) {
            return null;
        }
        return (BaseActivity) this.getActivity();
    }

    @Override
    public void onClick(View v) {

    }

    protected String getUsername(){
        return prefUtil.get(AppConstant.PREF_TOKEN.AUTH_USERNAME, "");
    }

    protected String getToken(){
        return prefUtil.get(AppConstant.PREF_TOKEN.AUTH_TOKEN, "");
    }

    @Override
    public void onError(int errorCode) {

    }
}
